Skip to content

Fix built-in examples update during build #10844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Fix built-in examples update during build #10844

merged 1 commit into from
Oct 9, 2020

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Oct 9, 2020

Previously, the built-in examples assembly step of the build system set the final_folder parameter of the unzip target to the true final installation location of the examples.

The behavior of the unzip target is to only unzip the archive if final_folder doesn't exist. Because that folder will exist any time a previous build has been done and ant clean was not run, the archive will not be unzipped. This causes the build to fail after an update to the built-in examples version when it attempts to copy the examples from the
version-dependent extraction staging folder to the final location.

The fix is to set the final_folder parameter to the version-dependent staging folder location, which will cause the extraction to happen every time the examples version is updated, but to be skipped when there was no update.

See #10734 (comment) for an explanation of the problem, and the steps to reproduce it here: #10734 (comment). (Thanks matthijskooijman!)

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes

Previously, the built-in examples assembly step of the build system set the
`final_folder` parameter of the `unzip` target to the true final
installation location of the examples.

The behavior of the `unzip` target is to only unzip the archive if
`final_folder` doesn't exist. Because that folder will exist any time a
previous build has been done and `ant clean` was not run, the archive will
not be unzipped. This causes the build to fail after an update to the
built-in examples version when it attempts to copy the examples from the
version-dependent extraction staging folder to the final location.

The fix is to set the `final_folder` parameter to the version-dependent
staging folder location, which will cause the extraction to happen every
time the examples version is updated, but to be skipped when there was no
update.
Copy link
Collaborator

@matthijskooijman matthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One nitpick is that now the ${BUILT-IN-EXAMPLES-STAGING-PATH}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}/examples path is duplicated twice, might be nicer to put that into a variable too (but that might be overengineering too).

@cmaglie cmaglie merged commit a056a5f into arduino:master Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants